package com.wnnight.wys.entity.role;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wnnight.wys.groupInterface.AddGroup;
import com.wnnight.wys.groupInterface.AlterGroup;
import lombok.*;

import javax.validation.constraints.NotNull;

/**
 * ClassName: MenuPerm
 * Description: 菜单权限表
 * author: dz
 * date: 2022-08-27-20:01
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("wys_menu") //告诉mybatis-plus,数据库表名叫什么
//keepGlobalPrefix() default false;
@ExcelIgnoreUnannotated
public class MenuPerm {
    @TableId(type = IdType.AUTO)
    @ExcelProperty(value = "id", index = 0)
    @NotNull(message = "菜单id不能为空",groups = AlterGroup.class)
    private Integer id;             //菜单ID
    @TableField("menu_name")
    @ExcelProperty(value = "菜单名称", index = 1)
    @NotNull(message = "菜单名称不能为空",groups = {AddGroup.class, AlterGroup.class})
    private String menuName; //菜单名称
    @TableField("parent_id")
    @ExcelProperty(value = "父id", index = 2)
    @NotNull(message = "父菜单ID不能为空",groups = {AddGroup.class, AlterGroup.class})
    private Integer parentId;   //父菜单ID
    @TableField("order_num")
    @ExcelProperty(value = "显示顺序", index = 3)
    private Integer orderNum; // 显示顺序
    @ExcelProperty(value = "路由地址", index = 4)
    private String url;              //路由地址
    @TableField("menu_type")
    @ExcelProperty(value = "菜单类型", index = 5)
    @NotNull(message = "菜单权限类型不能为空",groups = {AddGroup.class, AlterGroup.class})
    private String menuType;    // M目录 C菜单 F按钮
    @ExcelProperty(value = "权限标识", index = 6)
    private String perms;           //权限标识
    @ExcelProperty(value = "菜单图标", index = 7)
    private String icon;             //菜单图标
}
